﻿using System;
using System.Collections.ObjectModel;
using System.Data;
using BlueDot.Data.Core;
using Microsoft.Synchronization.Data;

namespace Syncronization
{
    public interface IServerSyncProvider : IDisposable
    {
        #region Properties

        /// <summary>
        /// Gets or sets the base URI.
        /// </summary>
        /// <value>The base URI.</value>
        Uri BaseURI { get; set; }

        /// <summary>
        /// Gets or sets the get changes web method.
        /// </summary>
        /// <value>The get changes web method.</value>
        string GetChangesWebMethod { get; set; }

        #endregion

        #region public

        /// <summary>
        /// Adds the schema.
        /// </summary>
        /// <param name="schemaBuilder">The schema builder.</param>
        void AddSchema(ISchemaBuilder schemaBuilder);

        /// <summary>
        /// Applies the changes.
        /// </summary>
        /// <param name="groupMetadata">The group metadata.</param>
        /// <param name="dataSet">The data set.</param>
        /// <param name="syncSession">The sync session.</param>
        /// <returns></returns>
        SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet,
                                 SyncSession syncSession);

        /// <summary>
        /// Gets the changes.
        /// </summary>
        /// <param name="groupMetadata">The group metadata.</param>
        /// <param name="syncSession">The sync session.</param>
        /// <returns></returns>
        SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession);

        /// <summary>
        /// Gets the schema.
        /// </summary>
        /// <param name="tableNames">The table names.</param>
        /// <param name="syncSession">The sync session.</param>
        /// <returns></returns>
        SyncSchema GetSchema(Collection<string> tableNames, SyncSession syncSession);

        #endregion
    }
}